package com.app.internationaltravel.controller;

import com.app.internationaltravel.service.intf.OssLogService;
import com.app.internationaltravel.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * @author 刘豆豆
 * @date 2022/12/13
 */
@RestController
@RequestMapping("/api/oss/")
@Api(tags = "实现文件上传的相关操作的相关操作")
@CrossOrigin //跨域
public class OssLogController {

  @Resource
  private OssLogService service;


  @ApiOperation(value = "图片上传", notes = "图片上传")
  @PostMapping("Img.do")
  public R uploadImg(@RequestPart MultipartFile file){
    return service.uploadImg(file);
  }

  @ApiOperation(value = "视频上传", notes = "视频上传")
  @PostMapping("Video.do")
  public R uploadIVideo(@RequestPart MultipartFile file){
    return service.uploadVideo(file);
  }

  @ApiOperation(value = "查询全部上传记录", notes = "查询全部上传记录")
  @GetMapping("all.do")
  public R all(){
    return service.all();
  }

}
